﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="database.DAO, golf.Channel"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>채널선택</title>
</head>

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<h1>채널 선택</h1>
<%
	DAO dao = DAO.getInstance();
	Channel[] channels = dao.getChannelList((Integer)session.getAttribute("serverNo"));
%>
<table border="1" cellspacing="0" bordercolordark="white" bordercolorlight="black" width="44%">
    <tr>
        <td width="242"><span style="font-size:9pt;">이름</span></td>
        <%
        for(int i = 0; i < channels.length; i++){%>
        	<td width="323"><span style="font-size:9pt;"><%=channels[i].getName() %></span></td>
        <%}%>
    </tr>
    <tr>
        <td width="242"><span style="font-size:9pt;">상태</span></td>
        <%
        for(int i = 0; i < channels.length; i++){%>
        	<td width="323"><span style="font-size:9pt;"><%=channels[i].getStatus() %></span></td>
        <%}%>
    </tr>
    <tr>
        <td width="242"><span style="font-size:9pt;">가용인원</span></td>
        <%
        for(int i = 0; i < channels.length; i++){%>
        	<td width="323"><span style="font-size:9pt;"><%=channels[i].getAvailable_person_cnt() %></span></td>
        <%}%>
    </tr>
    <tr>
        <td width="242"><span style="font-size:9pt;">현재입장인원</span></td>
        <%
        for(int i = 0; i < channels.length; i++){%>
        	<td width="323"><span style="font-size:9pt;"><%=channels[i].getNow_person_cnt() %></span></td>
        <%}%>
    </tr>
    <tr>
        <td width="242"><span style="font-size:9pt;">캐릭터제한등급</span></td>
        <%
        for(int i = 0; i < channels.length; i++){%>
        	<td width="323"><span style="font-size:9pt;"><%=channels[i].getLimited_character_grade() %></span></td>
        <%}%>
    </tr>
</table>
<form name="form1" action="../post/postSelectChannel.jsp" method="post">
    <p><span style="font-size:9pt;"><select name="selectChannel" size="1">
    	<%
        for(int i = 0; i < channels.length; i++){%>
        <option value="<%=channels[i].getNo()%>"><%=channels[i].getName() %></option>
        <%}%>
</select><input type="submit" name="action" value="채널 입장"></span></p>
</form>
</body>

</html>